private ["_lastrain","_rain","_overcast","_fogValue","_fogDecay","_fogHeight","_wind"];

_lastrain = rain;
_rain = 0;
_overcast = 0;
_fogValue = 0;
_fogDecay = 0;
_fogHeight =0;
_wind = [0,0,true];

_overcast = random 1;
if(_overcast > 0.5) then { 
	_rain = random 0.5;
} else { 
	_rain = 0;
};

if((date select 3 > 5) and (date select 3 <10)) then { 
	_fogValue = random 0.5;
	_fogDecay = 0.2;
	_fogHeight = random 20;
} else { 
	if((_lastrain > 0.6) and (_rain < 0.2)) then {
		_fogValue = random 0.2;
		_fogDecay = 0;
		_fogHeight = 0;
	} else {
		_fogValue = 0;
		_fogDecay = 0;
		_fogHeight = 0;
	};
};

if(random 1 > 0.95) then 
{
	_wind = [random 7, random 7, true];
} 
else 
{
	_wind = [random 3, random 3, false];
};

AfterlifeWeatherControl = [_rain, [_fogValue,_fogDecay,_fogHeight], _overcast, _wind, date];
60 setRain (AfterlifeWeatherControl select 0);
60 setfog (AfterlifeWeatherControl select 1);
60 setOvercast (AfterlifeWeatherControl select 2);
setwind (AfterlifeWeatherControl select 3);